﻿using System;

namespace ITCreatings.Ndb.Attributes
{
    /// <summary>
    /// Map class to a table record
    /// Allows to specify Table name. If not specifyed, 's' will be added to the class name.
    /// Ex: We have class User. By default we suppose it belongs to the "Users" table
    /// </summary>
    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
    public sealed class DbRecordAttribute : Attribute
    {
        /// <summary>
        /// name of the table associated with record
        /// </summary>
        public string TableName { get; private set; }

/*
        /// <summary>
        /// Gets or sets a value indicating whether all fields in this class are mapped.
        /// </summary>
        /// <value>
        /// 	<c>true</c> if all fields in this class are mapped; otherwise, <c>false</c>.
        /// </value>
        public bool IsAllFieldsMapped { get; set; }
*/
        /// <summary>
        /// TableName will be generated by addint 's' to the class name
        /// </summary>
        public DbRecordAttribute()
        {
        }

        /// <summary>
        /// Allows to specify database table name
        /// </summary>
        /// <param name="tableName"></param>
        public DbRecordAttribute(string tableName)
        {
            TableName = tableName;
        }
    }
}
